package com.hs.srm.admin.modules.requisition.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hs.srm.admin.modules.requisition.dao.ProPurchRequestHeaderSapDao;
import com.hs.srm.admin.modules.requisition.entity.ProPurchRequestHeaderEntity;
import com.hs.srm.admin.modules.requisition.service.ProPurchRequestHeaderSapService;
import org.springframework.stereotype.Service;

/**
 * @Description:生产性订单需求同步实现类
 * @Author socik
 * @date 2019/5/5 14:36
 */
@Service("proPurchRequestHeaderSapService")
public class ProPurchRequestHeaderSapServiceImpl extends ServiceImpl<ProPurchRequestHeaderSapDao, ProPurchRequestHeaderEntity> implements ProPurchRequestHeaderSapService {
    /**
     * @Description insertProHeader
     * @Param [headerEntity]
     * @Return boolean
     * @Author socik
     * @Date 2019/5/5 14:38
     */
    @Override
    public boolean insertProHeader(ProPurchRequestHeaderEntity headerEntity) {
        boolean flg = this.insert(headerEntity);
        return flg;
    }

    /**
     * @Description selectProHeader
     * @Param [bANFN]
     * @Author socik
     * @Date 2019/5/5 14:38
     */
    @Override
    public ProPurchRequestHeaderEntity selectProHeader(String bANFN) {
        EntityWrapper<ProPurchRequestHeaderEntity> queryWrapper = new EntityWrapper<ProPurchRequestHeaderEntity>();
        queryWrapper.eq("purch_request_code", bANFN);
        ProPurchRequestHeaderEntity one = this.selectOne(queryWrapper);
        if (one != null) {
            return one;
        }
        return null;
    }

    /**
     * @Description updateProHeader
     * @Param [headerEntity]
     * @Return boolean
     * @Author socik
     * @Date 2019/5/5 14:38
     */
    @Override
    public boolean updateProHeader(ProPurchRequestHeaderEntity headerEntity) {
        boolean flg = this.updateById(headerEntity);
        return flg;
    }


}

